/*
 * @Descripttion:
 * @version:
 * @Author: kl2018
 * @Date: 2020-03-17 09:11:31
 * @LastEditors: kl2018
 * @LastEditTime: 2020-08-18 10:02:36
 */
import React, { Component } from 'react';
import { WeaLocaleProvider } from 'ecCom';
// import BaseOdocTypeComp from "./common/BaseOdocTypeComp";
import { hashHistory } from 'react-router';

const { getLabel } = WeaLocaleProvider;

class ReceiveDocManegerComp extends Component {
  constructor(props) {
    super(props);
    hashHistory.replace({
      pathname: '/main/offical/customPage',
      query: {
        customListId: -12,
        ...props.location.query,
      },
    });
  }

  render() {
    return (<span />);
    // const {location:{query}} = this.props;
    // const compProps = this.getCompProps(query)
    // return (
    //   <BaseOdocTypeComp
    //     topTitle={getLabel('387595','发文管理')}
    //     tabParams={{reqType:1}}
    //     searchParams={{officalType:1}}
    //     tableParams={{officalType:1}}
    //     {...compProps}
    //     {...this.props}
    //   />
    // )
  }

  getCompProps(query) {
    let compProps = {};
    if (query.flowtype) {
      if (query.flowtype == '0') {
        compProps.topTitle = getLabel('33769', '待办发文');
      }
      if (query.flowtype == '1') {
        compProps.topTitle = getLabel('33770', '已办发文');
      }
      if (query.flowtype == '2') {
        compProps.topTitle = getLabel('509714', '待阅发文');
      }
      if (query.flowtype == '3') {
        compProps.topTitle = getLabel('509717', '已阅发文');
      }
      if (query.flowtype == '4') {
        compProps.topTitle = getLabel('514551', '超时发文');
      }
      if (query.flowtype == '5') {
        compProps.topTitle = getLabel('514552', '在办发文');
      }
      if (query.flowtype == '6') {
        compProps.topTitle = getLabel('514553', '未办发文');
      }
      compProps.tabParams = null;
      compProps.tabUrl = null;
      compProps.tableParams = { officalType: 1, flowtype: query.flowtype };
    }
    return compProps;
  }
}

export default props => <ReceiveDocManegerComp ecId={`${this && this.props && this.props.ecId || ''}_ReceiveDocManegerComp@71os7h`} {...props} key={props.location.query.flowtype || '-1'} />;

